home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / qwakprot.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  8KB  |  272 lines

  1. /***************************************************************************
  2.  
  3.   Qwak (prototype) driver.
  4.  
  5.   This driver is based *extremely* loosely on the Centipede driver.
  6.  
  7.   The following memory map is pure speculation:
  8.  
  9.   0000-01FF     R/W        RAM
  10.   0200-025F     R/W        RAM?  ER2055 NOVRAM maybe?
  11.   0300-03FF     R/W        RAM
  12.   0400-07BF        R/W        Video RAM
  13.   07C0-07FF        R/W        Sprite RAM
  14.   1000            W        ???
  15.   2000            W        ???
  16.   2001            W        ???
  17.   2003          W        Start LED 1
  18.   2004          W        Start LED 2
  19.   3000            R        $40 = !UP            $80 = unused?
  20.   3001            R        $40 = !DOWN            $80 = ???
  21.   3002            R        $40 = !LEFT            $80 = ???
  22.   3003            R        $40 = !RIGHT        $80 = unused?
  23.   3004            R        $40 = !START1        $80 = ???
  24.   3005            R        $40 = !START2        $80 = !COIN
  25.   3006            R        $40 = !BUTTON1        $80 = !COIN
  26.   3007            R        $40 = unused?        $80 = !COIN
  27.   4000          R        ???
  28.   6000-600F        R/W        Pokey 1
  29.   7000-700F        R/W        Pokey 2
  30.   8000-BFFF        R        ROM
  31.  
  32.   TODO:
  33.     - fix colors
  34.     - coins seem to count twice instead of once?
  35.     - find DIP switches (should be at $4000, I would think)
  36.     - figure out what $1000, $2000, and $2001 are used for
  37.     - figure out exactly what the unknown bits in the $3000 area do
  38.  
  39.  
  40. If you have any questions about how this driver works, don't hesitate to
  41. ask.  - Mike Balfour (mab22@po.cwru.edu)
  42. ***************************************************************************/
  43.  
  44. #include "driver.h"
  45. #include "vidhrdw/generic.h"
  46.  
  47. void qwakprot_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  48. WRITE_HANDLER( qwakprot_paletteram_w );
  49.  
  50.  
  51. static WRITE_HANDLER( qwakprot_led_w )
  52. {
  53.     osd_led_w(offset,~data >> 7);
  54. }
  55.  
  56. static struct MemoryReadAddress readmem[] =
  57. {
  58.     { 0x0000, 0x01ff, MRA_RAM },
  59.     { 0x0200, 0x025f, MRA_RAM },
  60.     { 0x0300, 0x03ff, MRA_RAM },
  61.     { 0x0400, 0x07ff, MRA_RAM },
  62.     { 0x3000, 0x3000, input_port_0_r },
  63.     { 0x3001, 0x3001, input_port_1_r },
  64.     { 0x3002, 0x3002, input_port_2_r },
  65.     { 0x3003, 0x3003, input_port_3_r },
  66.     { 0x3004, 0x3004, input_port_4_r },
  67.     { 0x3005, 0x3005, input_port_5_r },
  68.     { 0x3006, 0x3006, input_port_6_r },
  69.     { 0x3007, 0x3007, input_port_7_r },
  70.     { 0x4000, 0x4000, input_port_8_r },            /* just guessing */
  71.     { 0x6000, 0x600f, pokey1_r },
  72.     { 0x7000, 0x700f, pokey2_r },
  73.     { 0x8000, 0xbfff, MRA_ROM },
  74.     { 0xf000, 0xffff, MRA_ROM },    /* for the reset / interrupt vectors */
  75.     { -1 }    /* end of table */
  76. };
  77.  
  78. static struct MemoryWriteAddress writemem[] =
  79. {
  80.     { 0x0000, 0x01ff, MWA_RAM },
  81.     { 0x0200, 0x025f, MWA_RAM },
  82.     { 0x0300, 0x03ff, MWA_RAM },
  83.     { 0x0400, 0x07bf, videoram_w, &videoram, &videoram_size },
  84.     { 0x07c0, 0x07ff, MWA_RAM, &spriteram },
  85.     { 0x1c00, 0x1c0f, qwakprot_paletteram_w, &paletteram }, /* just guessing */
  86. //    { 0x2000, 0x2001, coin_counter_w },
  87.     { 0x2003, 0x2004, qwakprot_led_w },
  88.     { 0x6000, 0x600f, pokey1_w },
  89.     { 0x7000, 0x700f, pokey2_w },
  90.     { 0x8000, 0xbfff, MWA_ROM },
  91.     { -1 }    /* end of table */
  92. };
  93.  
  94.  
  95.  
  96. INPUT_PORTS_START( qwakprot )
  97.     PORT_START    /* IN0 */
  98.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
  99.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )            /* ??? */
  100.  
  101.     PORT_START      /* IN1 */
  102.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
  103.     PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )            /* ??? */
  104.  
  105.     PORT_START      /* IN2 */
  106.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
  107.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )            /* ??? */
  108.  
  109.     PORT_START      /* IN3 */
  110.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
  111.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )            /* ??? */
  112.  
  113.     PORT_START      /* IN4 */
  114.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  115.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )            /* ??? */
  116.  
  117.     PORT_START      /* IN5 */
  118.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  119.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  120.  
  121.     PORT_START      /* IN6 */
  122.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
  123.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
  124.  
  125.     PORT_START      /* IN7 */
  126.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )            /* ??? */
  127.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN3 )
  128.  
  129.     PORT_START      /* IN8 */
  130.     PORT_DIPNAME( 0x01, 0x00, "DIP 1" )
  131.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  132.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  133.     PORT_DIPNAME( 0x02, 0x00, "DIP 2" )
  134.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  135.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  136.     PORT_DIPNAME( 0x04, 0x00, "DIP 3" )
  137.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  138.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  139.     PORT_DIPNAME( 0x08, 0x00, "DIP 4" )
  140.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  141.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  142.     PORT_DIPNAME( 0x10, 0x00, "DIP 5" )
  143.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  144.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  145.     PORT_DIPNAME( 0x20, 0x00, "DIP 6" )
  146.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  147.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  148.     PORT_DIPNAME( 0x40, 0x00, "DIP 7" )
  149.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  150.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  151.     PORT_DIPNAME( 0x80, 0x00, "DIP 8" )
  152.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  153.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  154. INPUT_PORTS_END
  155.  
  156.  
  157. static struct GfxLayout charlayout =
  158. {
  159.     8,8,    /* 8*8 characters */
  160.     128,    /* 128 characters */
  161.     4,    /* 4 bits per pixel */
  162.     { 0x3000*8, 0x2000*8, 0x1000*8, 0 },    /* the four bitplanes are separated */
  163.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  164.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  165.     16*8    /* every char takes 8 consecutive bytes, then skip 8 */
  166. };
  167.  
  168. static struct GfxLayout spritelayout =
  169. {
  170.     8,16,    /* 16*8 sprites */
  171.     128,    /* 128 sprites */
  172.     4,    /* 4 bits per pixel */
  173.     { 0x3000*8, 0x2000*8, 0x1000*8, 0 },    /* the four bitplanes are separated */
  174.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  175.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  176.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  177.     16*8    /* every sprite takes 16 consecutive bytes */
  178. };
  179.  
  180.  
  181. static struct GfxDecodeInfo gfxdecodeinfo[] =
  182. {
  183.     { REGION_GFX1, 0x0800, &charlayout,   0, 1 },
  184.     { REGION_GFX1, 0x0808, &charlayout,   0, 1 },
  185.     { REGION_GFX1, 0x0000, &spritelayout, 0, 1 },
  186.     { -1 } /* end of array */
  187. };
  188.  
  189.  
  190.  
  191. static struct POKEYinterface pokey_interface =
  192. {
  193.     2,    /* 2 chips */
  194.     1500000,    /* 1.5 MHz??? */
  195.     { 50, 50 },
  196.     /* The 8 pot handlers */
  197.     { 0, 0 },
  198.     { 0, 0 },
  199.     { 0, 0 },
  200.     { 0, 0 },
  201.     { 0, 0 },
  202.     { 0, 0 },
  203.     { 0, 0 },
  204.     { 0, 0 },
  205.     /* The allpot handler */
  206.     { 0, 0 },
  207. };
  208.  
  209.  
  210. static struct MachineDriver machine_driver_qwakprot =
  211. {
  212.     /* basic machine hardware */
  213.     {
  214.         {
  215.             CPU_M6502,
  216.             12096000/8,    /* 1.512 Mhz?? */
  217.             readmem,writemem,0,0,
  218.             interrupt,4
  219.         }
  220.     },
  221.     60, 1460,    /* frames per second, vblank duration??? */
  222.     1,    /* single CPU, no need for interleaving */
  223.     0,
  224.  
  225.     /* video hardware */
  226.     32*8, 32*8, { 0*8, 32*8-1, 0*8, 30*8-1 },
  227.     gfxdecodeinfo,
  228.     16, 16,
  229.     0,
  230.  
  231.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY|VIDEO_MODIFIES_PALETTE,
  232.     0,
  233.     generic_vh_start,
  234.     generic_vh_stop,
  235.     qwakprot_vh_screenrefresh,
  236.  
  237.     /* sound hardware */
  238.     0,0,0,0,
  239.     {
  240.         {
  241.             SOUND_POKEY,
  242.             &pokey_interface
  243.         }
  244.     }
  245. };
  246.  
  247.  
  248. /***************************************************************************
  249.  
  250.   Game ROMs
  251.  
  252. ***************************************************************************/
  253.  
  254. ROM_START( qwakprot )
  255.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  256.     ROM_LOAD( "qwak8000.bin", 0x8000, 0x1000, 0x4d002d8a )
  257.     ROM_LOAD( "qwak9000.bin", 0x9000, 0x1000, 0xe0c78fd7 )
  258.     ROM_LOAD( "qwaka000.bin", 0xa000, 0x1000, 0xe5770fc9 )
  259.     ROM_LOAD( "qwakb000.bin", 0xb000, 0x1000, 0x90771cc0 )
  260.     ROM_RELOAD(               0xf000, 0x1000 )    /* for the reset and interrupt vectors */
  261.  
  262.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  263.     ROM_LOAD( "qwakgfx0.bin", 0x0000, 0x1000, 0xbed2c067 )
  264.     ROM_LOAD( "qwakgfx1.bin", 0x1000, 0x1000, 0x73a31d28 )
  265.     ROM_LOAD( "qwakgfx2.bin", 0x2000, 0x1000, 0x07fd9e80 )
  266.     ROM_LOAD( "qwakgfx3.bin", 0x3000, 0x1000, 0xe8416f2b )
  267. ROM_END
  268.  
  269.  
  270.  
  271. GAMEX( 1982, qwakprot, 0, qwakprot, qwakprot, 0, ROT270, "Atari", "Qwak (prototype)", GAME_NO_COCKTAIL )
  272.